package dao

import (
	"user_srv/global"
	"user_srv/model"
)

func GetUserByMobile(mobile string) (model.User, error) {

	var user model.User
	err := global.DB.Where("mobile = ?", mobile).First(&user).Error
	if err != nil {
		return model.User{}, err
	}
	return user, nil
}
func Create(user model.User) error {
	return global.DB.Create(&user).Error
}
